package com.dongdongshop.serviec.brand;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.seller.TbBrandMapper;
import com.dongdongshop.pojo.seller.TbBrand;
import com.dongdongshop.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
@Service
public class BrandServiceImpl implements BrandService {
    @Resource
    private TbBrandMapper tbBrandMapper;

    @Override
    public int deleteBrand(Integer[] ids) {
        return tbBrandMapper.deleteBrand(ids);
    }

    @Override
    public int updateBrandById(TbBrand tbBrand) {
        return tbBrandMapper.updateByPrimaryKeySelective(tbBrand);
    }

    @Override
    public TbBrand getBrandById(Long id) {
        return tbBrandMapper.selectByPrimaryKey(id);
    }

    @Override
    public int addBrand(TbBrand tbBrand) {
        return tbBrandMapper.insertSelective(tbBrand);
    }

    @Override
    public List<TbBrand> getInfo() {
       // System.out.println(1111);
        List<TbBrand> list=tbBrandMapper.selectByExample(null);
       // System.out.println("查询"+list);
        return list;

    }
}
